package Factory;

import dao.Impl.UserDaoImpl;
import dao.UserDao;
import org.springframework.beans.factory.FactoryBean;

public class UserDaoFactoryBean implements FactoryBean<UserDao> {
    // 代替原始工厂中创建对象的方法, 替代了实例里的 createUser()
    @Override
    public UserDao getObject() throws Exception {
        return new UserDaoImpl();
    }
    //
    @Override
    public Class<?> getObjectType() {
        return UserDao.class;
    }
}
